home *** CD-ROM | disk | FTP | other *** search
/ The History of Denim / The History of Denim.iso / pc / _time.dir / 00002_Utilities.ls < prev    next >
Encoding:
Text File  |  1997-11-14  |  1.8 KB  |  57 lines

  1. on CheckMovement
  2.   global WhoWhere, WhosHot, MouseMGR, MyPosition
  3.   if the locH of sprite 15 < 0 then
  4.     set the locH of sprite 15 to 0
  5.   end if
  6.   if the locH of sprite 15 > 573 then
  7.     set the locH of sprite 15 to 573
  8.   end if
  9.   if the locH of sprite 15 <> MyPosition then
  10.     if the locH of sprite 15 > 60 then
  11.       set Changeit to the locH of sprite 15 - MyPosition
  12.       set WhoWhere to WhoWhere + (Changeit * -9)
  13.       set WhosHot to SlideRect(WhosHot, Changeit * -9)
  14.       set MyPosition to the locH of sprite 15
  15.     else
  16.       ZeroLists()
  17.     end if
  18.   end if
  19. end
  20.  
  21. on SnapTab loc
  22.   global WhoWhere
  23.   set Snapto to [rect(0, 456, 59, 480), rect(59, 456, 118, 480), rect(124, 456, 183, 480), rect(188, 456, 247, 480), rect(252, 456, 311, 480), rect(317, 456, 376, 480), rect(381, 456, 440, 480), rect(445, 456, 504, 480), rect(509, 456, 568, 480), rect(573, 456, 632, 480)]
  24.   if loc = 0 then
  25.     repeat with a = 1 to count(Snapto)
  26.       if inside(point(the mouseH, the mouseV), getAt(Snapto, a)) then
  27.         set the rect of sprite 15 to getAt(Snapto, a)
  28.         gotoSection(a)
  29.         exit
  30.       end if
  31.     end repeat
  32.   else
  33.     set the rect of sprite 15 to getAt(Snapto, loc)
  34.     gotoSection(loc)
  35.   end if
  36. end
  37.  
  38. on gotoSection position
  39.   global WhoWhere, WhosHot
  40.   set positionlist to [0, 0, 640, 1280, 1920, 2560, 3200, 3840, 4480, 5120, 5760]
  41.   ZeroLists()
  42.   set WhoWhere to WhoWhere - getAt(positionlist, position)
  43.   set WhosHot to SlideRect(WhosHot, -1 * getAt(positionlist, position))
  44. end
  45.  
  46. on DisplayTimeline
  47.   global WhoWhere, WhosHot
  48.   repeat with a = 1 to count(WhoWhere)
  49.     set MyX to getAt(WhoWhere, a)
  50.     set the rect of sprite a to rect(MyX, 0, MyX + 640, 480)
  51.   end repeat
  52.   repeat with a = 1 to count(WhosHot)
  53.     set displayrect to getAt(WhosHot, a) + rect(-1, -1, -1, -1)
  54.     set the rect of sprite (a + 30) to displayrect
  55.   end repeat
  56. end
  57.